home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NetNews Offline 2
/
NetNews Offline Volume 2.iso
/
news
/
comp
/
std
/
c
/
504
< prev
next >
Wrap
Text File
|
1996-08-06
|
2KB
|
70 lines
Newsgroups: comp.sys.hp.hpux,comp.std.c,comp.lang.c
Path: news.sprintlink.net!news!devil
From: devil@tpoint.net (The Devil Himself)
Subject: struct init problem
Message-ID: <DnrAEx.HA@tpoint.net>
Followup-To: poster
Reply-To: devil@tpoint.net
Organization: Not Hardly!
Distribution: na
Date: Mon, 4 Mar 1996 18:37:45 GMT
I found that the attached code does not compile on HP's, but does compile on
UNIXware, etc. I'd like to hear any ideas beside my hacked solution.
I'm looking for a way to preserve using the struct = { .... } syntax.
Also, who you characterize this problem vs. ansi C.....
E-mail answers please....
Thanks - D
_+_+_+_+_+_+_ problem code _+_+_+_+
struct testme
{
int dum_huh ;
int * p ;
} ;
void foofunk( void )
{
int ima_int = 0xdeadbeef ;
{
struct test_me please =
{
0xbeefdead ,
& ima_int
} ;
/*
* NOTE: HP-UX foo A.09.05 A 9000/712
* wont compile this & ima_int statement, unless I declare
* BOTH ima_int AND please as "static". unfortunately, I want this
* code to be reenterant.
*/
}
/* whatever */
}
_+_+_+_+_+_+ hack solution _+_+_+_+_+
void foofunk( void )
{
int ima_int = 0xdeadbeef ;
{
struct test_me please =
{
0xbeefdead ,
} ;
please . p = & ima_int
/* whatever */
}
/* whatever */
}
--
.... (C) 1995 Copyright Duncan Idaho, All Rights Reserved ..................
There are "three absolute rights [sic] the right of personal security, personal
liberty and personal property," Sir William Blackstone. "The protection of
these faculties is the first object of government." Madison, Federalist 10.